Optimal. Leaf size=52 \[ x-\frac {4 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4042, 3919, 3831, 2659, 208} \[ x-\frac {4 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 2659
Rule 3831
Rule 3919
Rule 4042
Rubi steps
\begin {align*} \int \frac {a^2-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx &=-\int \frac {-a+b \sec (c+d x)}{a+b \sec (c+d x)} \, dx\\ &=x-(2 b) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx\\ &=x-2 \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx\\ &=x-\frac {4 \operatorname {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d}\\ &=x-\frac {4 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 56, normalized size = 1.08 \[ \frac {4 b \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{d \sqrt {a^2-b^2}}+\frac {c}{d}+x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.52, size = 226, normalized size = 4.35 \[ \left [\frac {{\left (a^{2} - b^{2}\right )} d x + \sqrt {a^{2} - b^{2}} b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right )}{{\left (a^{2} - b^{2}\right )} d}, \frac {{\left (a^{2} - b^{2}\right )} d x - 2 \, \sqrt {-a^{2} + b^{2}} b \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right )}{{\left (a^{2} - b^{2}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.24, size = 235, normalized size = 4.52 \[ -\frac {\frac {{\left (\sqrt {-a^{2} + b^{2}} {\left (a + b\right )} {\left | a \right |} {\left | -a + b \right |} - {\left (a^{2} - 3 \, a b\right )} \sqrt {-a^{2} + b^{2}} {\left | -a + b \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b + \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} a^{2} + {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} {\left | a \right |}} - \frac {{\left (a^{2} - 3 \, a b + a {\left | a \right |} + b {\left | a \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {b - \sqrt {{\left (a + b\right )} {\left (a - b\right )} + b^{2}}}{a - b}}}\right )\right )}}{a^{2} - b {\left | a \right |}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.80, size = 61, normalized size = 1.17 \[ -\frac {4 b \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.98, size = 182, normalized size = 3.50 \[ x-\frac {4\,b\,\mathrm {atanh}\left (\frac {8\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+5\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,a\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,\left (a\,\left (a^2-b^2\right )+b\,\left (a^2-b^2\right )+4\,a\,b^2-2\,a^2\,b-2\,b^3\right )}\right )}{d\,\sqrt {a^2-b^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a - b \sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________